Skip to main content

Debugging Your SDK

With the TS-Chart-SDK, we provide the feature of debugging your custom chart when it is integrated with ThoughtSpot.

Enabling Debugging

To debug your custom chart with ThoughtSpot, you need to pass debug=true as a query parameter in your cluster URL.

debug_param

This will enable some console statements in your console. You can search in your console for the logs that start with TsChartSDKContext. Under this, you will find two types of console logs:

Console Log Types

  1. Chart Context: message received: This log indicates messages received from ThoughtSpot when a particular TStoChart event is fired.

  2. ChartContext: Response:: This log indicates the response that the listener is sending back to ThoughtSpot based on the listeners that are present.

These two represent different types of logs: one is related to messages received from ThoughtSpot, and the other is the response sent back to ThoughtSpot.

NOTE: We provide internal listeners in our SDK for many events. You can also add your own event listeners using ctx.on(). You can add these, and the last one that is added will determine the response you receive.

In both the response logs, you will get the eventType on which the event is occurring and the data that is being exchanged.

Other Console Logs

There are other console logs related to different scenarios that the SDK encounters. These logs start with specific names and have scenarios mentioned accordingly.

Error Messages and Descriptions

Error MessageDescription
No event listener found to removeThis occurs if there is no event listener corresponding to an event.
Chart Context: not initialized the context, something went wrongThis error appears if the chart is not initialized and emitEvent is called before initialization.
ContextMenuCustomAction: payload received:This message is logged if your custom context action encounters an error while running.
AxisMenuCustomAction: payload received:This message is logged if your custom axis menu action encounters an error.